import * as React from 'react';
import {Route} from 'react-router';
import Home from '../page/home';
import User from '../page/user';
import Coin from '../page/coin';
import CoinCreate from '../page/coin/create';
import Notification from '../page/notification';
import NotificationCreate from '../page/notification/create';
import NotificationRead from '../page/notification_read';
import Editor from '../page/user/edit';

const NotFound = () => {
    return (
        <Route render={({staticContext}: any) => {
            if (staticContext) {
                staticContext.status = 404;
            }
            return (
                <div>
                    <h1>404 : Not Found</h1>
                </div>
            );
        }}/>
    );
};

export default [{
    path: '/',
    component: Home,
    exact: true
}, {
    path: '/user/list',
    component: User,
    exact: true
}, {
    path: '/user/list/edit/:user_id',
    component: Editor,
    exact: true
}, {
    path: '/coin/list',
    component: Coin,
    exact: true
}, {
    path: '/coin/create',
    component: CoinCreate,
    exact: true
}, {
    path: '/notification/list',
    component: Notification,
    exact: true
},{
    path: '/notification/create',
    component: NotificationCreate,
    exact: true
},{
    path: '/notification/read/list',
    component: NotificationRead,
    exact: true
}, {
    path: '*',
    component: NotFound
}];
